<?php


namespace app\library\create;


use app\core\exception\ApiException;
use app\library\create\lib\CreateFile;
use app\library\create\lib\CreateModel;
use app\library\create\lib\GetFields;
use Exception;
use think\facade\Db;

class CreateHandler
{


    /**
     * @param array $tableNames 需要创建的表名,不传就是生成所有数据模型
     * @throws ApiException
     */
    public static function create($tableNames = [])
    {
        $prefix = config('database.connections.mysql.prefix');
        $tableFields = GetFields::index($tableNames, $prefix); //获得数据库字段信息
        CreateFile::create($tableFields, $prefix); //创建文件
    }


}